modifier_dice_motion = class({})

--------------------------------------------------------------------------------

function modifier_dice_motion:OnCreated( kv )
	if IsServer() then
		self.speed = 1600 / 3
		if self:ApplyVerticalMotionController() == false then 
			self:Destroy()
			
		end
	end
end

-- --------------------------------------------------------------------------------

-- function modifier_dice_motion:CheckState()
-- 	local state = {
-- 		[MODIFIER_STATE_UNSELECTABLE] = true,
-- 		[MODIFIER_STATE_INVULNERABLE] = true,
-- 		[MODIFIER_STATE_NO_HEALTH_BAR] = true,
-- 		[MODIFIER_STATE_MAGIC_IMMUNE] = true,
-- 		[MODIFIER_STATE_ATTACK_IMMUNE] = true,
-- 		[MODIFIER_STATE_LOW_ATTACK_PRIORITY] = true,
-- 	}

-- 	return state
-- end

--------------------------------------------------------------------------------

function modifier_dice_motion:UpdateVerticalMotion( me, dt )
	if IsServer() then
		local hero = self:GetParent()
		local pos = hero:GetAbsOrigin()
		if math.abs(hero.origin_pos.z - pos.z) < 10 then
			hero:InterruptMotionControllers(true)
		else
			hero:SetAbsOrigin( hero:GetAbsOrigin() - self.speed )
		end
	end
end
